package com.atguigu.spzx.manager.controller;

import com.atguigu.spzx.manager.service.SysRoleMenuService;
import com.atguigu.spzx.model.vo.common.Result;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.annotation.Resource;
import org.springframework.web.bind.annotation.*;

import java.util.List;

@RestController
@Tag(name ="角色菜单管理模块")
@RequestMapping("/admin/system/roleMenu")
public class SysRoleMenuController {
    @Resource
    SysRoleMenuService sysRoleMenuService;
    @Operation(summary = "给角色分配菜单")
    @PutMapping("assignMenus/{roleId}")
    public Result assignMenus(@RequestBody List<Long> menuIds , @PathVariable("roleId")Long roleId){
        sysRoleMenuService.assignMenus(roleId , menuIds);
        return Result.ok(null);
    }

}
